package service;

import Util.SqlSessionUtil;
import dao.NingboGrowthRateMapper;
import dao.ZhejiangGrowthRateMapper;
import domain.NingboGrowthRate;
import domain.ZhejiangGrowthRate;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class ZhejiangGrowthRateService {
    public List<ZhejiangGrowthRate> selectDataByCityAndYear(String county, Integer year) {
        SqlSession session = SqlSessionUtil.getSession().openSession();
        ZhejiangGrowthRateMapper userOperation = session
                .getMapper(ZhejiangGrowthRateMapper.class);
        List<ZhejiangGrowthRate> list = userOperation.selectByCityAndYear(county, year);
        session.commit();
        session.close();
        return list;
    }

    public static void main(String[] args) {
        ZhejiangGrowthRateService z = new ZhejiangGrowthRateService();
        System.out.println(z.selectDataByCityAndYear("宁波", 2016));
    }
}
